package com.example.cron;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Schedule {
    @Scheduled(fixedRate = 2000)
    void a() {
        System.out.println("这是一个定时任务");
    }
}
